<?php

/**
 * PartnerFamily form base class.
 *
 * @package    form
 * @subpackage partner_family
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BasePartnerFamilyForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'name'                => new sfWidgetFormInput(),
      'relationshiptype_id' => new sfWidgetFormDoctrineChoice(array('model' => 'RelationshipType', 'add_empty' => false)),
      'px_no'               => new sfWidgetFormInput(),
      'passenger_id'        => new sfWidgetFormDoctrineChoice(array('model' => 'Passenger', 'add_empty' => false)),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorDoctrineChoice(array('model' => 'PartnerFamily', 'column' => 'id', 'required' => false)),
      'name'                => new sfValidatorString(array('max_length' => 255)),
      'relationshiptype_id' => new sfValidatorDoctrineChoice(array('model' => 'RelationshipType')),
      'px_no'               => new sfValidatorInteger(),
      'passenger_id'        => new sfValidatorDoctrineChoice(array('model' => 'Passenger')),
      'created_at'          => new sfValidatorDateTime(array('required' => false)),
      'updated_at'          => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('partner_family[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'PartnerFamily';
  }

}
